Repository navigation
Channel and Dataflow pumps: drop the first-wait flags - #281
Merged
Merged
Conversation
ChannelPump.Run and BlockPump.Run took a flag (waitFirst, checkOpen) that was false at exactly one caller each: the call that makes a fresh channel or block. Every other caller passed true. The flag is gone; the pass now always does the first WaitToWriteAsync (a channel) or the completed-check (a block). On a fresh channel the wait returns at once and the block is not completed, so the behavior of those two callers is unchanged. One edge differs: a block created with options whose cancellation token is already cancelled is already completed. The pass now returns 0 without running a command; before, it ran the query and stopped at the first row. The block ends cancelled either way. The shared frame between the two pumps is left as two copies: a Core frame would need a feed interface over the target type plus a small adapter per package, which adds about what it removes and splits one short frame across projects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ChannelPump.RunandBlockPump.Runeach took a flag (waitFirst,checkOpen) that wasfalseat exactly one caller andtrueat every other. The flags are removed: a pass now always does the firstWaitToWriteAsync(channel) or the completed-check (block).The one
falsecaller in each package creates a fresh channel or block, so the wait returns at once and the block is not completed: no change for them. One edge differs: a block created with options whose cancellation token is already cancelled is already completed. Its pass now returns 0 without running a command; before, it ran the query and stopped at the first row. The block ends cancelled either way.Not done: a shared frame for the two pumps. The try / record-error / rethrow / finally-complete frame is about 20 lines per package. Sharing it would need a Core frame, a feed interface generic over the target type, and a small adapter per package for "wait for room or check completed" and "complete or fault". That adds about as many lines as it removes, and splits one short frame across projects. The per-row loops stay per package either way. Left as two copies.
No public API change. 8 lines added, 23 removed.
Tested on net11.0: Core.Tests passes in Release (15571 passed) and Debug (15554 passed, 16 skipped, none failing). Core, Channel and Dataflow build with 0 warnings and 0 errors, style enforced.
🤖 Generated with Claude Code